/*
    File.h - Abstraction of a file, loaded to memory
    License: BSD
*/
#ifndef FILE_H_INCLUDED
#define	FILE_H_INCLUDED

#ifndef BYTEBUFFER_H_INCLUDED
#include "ByteBuffer.h"
#endif

class File {
public:
    File();
    virtual ~File();
    virtual void read  ( const char* filename );
    virtual void write ( const char* filename ) const;
    unsigned int length() const;
    char* operator[](int idx);
    ByteBuffer&       get_buffer();
    const ByteBuffer& get_buffer() const;

private:
    ByteBuffer m_bytes;
};

#endif	/* FILE_H */

